package com.flashmoment.video.service.impl;

import com.flashmoment.video.utils.PageUtils;
import com.flashmoment.video.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import com.flashmoment.video.dao.UserCollectDao;
import com.flashmoment.video.entity.UserCollectEntity;
import com.flashmoment.video.service.UserCollectService;


@Service("userCollectService")
public class UserCollectServiceImpl extends ServiceImpl<UserCollectDao, UserCollectEntity> implements UserCollectService {

    @Autowired
    private UserCollectDao userCollectDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<UserCollectEntity> page = this.page(
                new Query<UserCollectEntity>().getPage(params),
                new QueryWrapper<UserCollectEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public Integer deleteBatch(List<Integer> ids) {
        return userCollectDao.deleteBatch(ids);
    }

}